home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 050a / margar31.zip / MARG.DOC < prev    next >
Text File  |  1993-03-14  |  21KB  |  489 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                             _______
  8.                        ____|__     |               (TM)
  9.                     --|       |    |-------------------
  10.                       |   ____|__  |  Association of
  11.                       |  |       |_|  Shareware
  12.                       |__|   o   |    Professionals
  13.                     -----|   |   |---------------------
  14.                          |___|___|    MEMBER
  15.         
  16.                            MARGARINE Version 3.11
  17.                      Copyright 1991 by Tay-Jee Software
  18.         
  19.            OK, so why is this program called MARGARINE?  Because it
  20.         "spreads" the MARGins of your text files!!
  21.         
  22.            So much for bad humor...
  23.            
  24.            If you evaluate alot of shareware programs (and I do), you
  25.         might be annoyed at how so many times the left margin of the
  26.         documentation file is in column 0, or there are no page breaks
  27.         or page numbers.  When printing out the file, this can lead to
  28.         a really lopsided-looking document, especially if the right 
  29.         margin is in the 60-70 column range.  If you wanted to punch 
  30.         holes in the document and put it into a binder, you would end 
  31.         up punching out some of the text in the first few columns.  
  32.         While several print utilities such as Norm Patriquin's PPRINT 
  33.         (an excellent program, by the way) allow you to specify a left
  34.         margin while printing, they have several drawbacks:
  35.         
  36.               a) if you select too large of a value for the left
  37.               margin, some lines will "overflow" onto the next
  38.               line.  This, in turn, will screw up page formatting
  39.               and page lengths.
  40.         
  41.               b) most of these programs take over your machine instead
  42.               of running in the background like DOS print.  This can
  43.               be a real inconvenience when printing 200K+ documentation
  44.               files.
  45.             
  46.            OK, so what's the point?
  47.            
  48.            MARGARINE 3.11 is a very simple program I wrote to overcome
  49.         both of these problems.  First, MARGARINE will scan your entire
  50.         document in order to find the longest single line.  Based on
  51.         this length, it calculates how much of a "buffer" can be added
  52.         to each line in the file without pushing the right margin off
  53.         the edge of the screen/paper.  MARGARINE will then add whatever 
  54.         amount of "padding" you specify to the left margin of the doc-
  55.         ument and write the result to a new file.  Optionally, MARGA-
  56.         RINE will add top and bottom margins and paginate your docu-
  57.         ment for you.  The resulting document can then be printed from
  58.         the DOS command line (using PRINT.COM or PRINT.EXE) and will 
  59.         have a nice left margin.
  60.         
  61.  
  62.                                      Page 1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.         
  69.         STARTING THE PROGRAM
  70.         
  71.            MARGARINE Version 3.11 contains a new menu-driven interface.  
  72.         In order to make use of the interface, type MARG by itself on   
  73.         the command line.                                               
  74.         
  75.            When the program begins, you will see a square menu centered 
  76.         on the screen.  Several options will be listed on the lefthand  
  77.         side of the menu, with the first highlighted.  Space exists on  
  78.         the righthand side of the menu for various program information. 
  79.         
  80.            Select an option by using the up/down cursor keys to position
  81.         the highlight over the desired option, then pressing Enter.     
  82.         Each option will require you to select information from a scrol-
  83.         ling menu, or to type in information in a dialog box.  Options  
  84.         (and corresponding input choices) are described below:          
  85.         
  86.            INPUT FILE:  Select this option to specify the name of a file
  87.         to format.  A list of all files in the CURRENT directory will be
  88.         displayed on the center  of the screen.  Scroll up and down the 
  89.         list until you find the file you want, then press Enter.  The   
  90.         selected file name will appear on the menu.                     
  91.         
  92.            OUTPUT FILE:  Select this option to specify a file name to   
  93.         which the formatted text will be written.  Type any legal DOS   
  94.         filename in the dialog box.                                     
  95.         
  96.            TOP MARGIN:  Select this option to specify a top page margin 
  97.         in rows.  A maximum of 30 rows a permitted.                     
  98.         
  99.            BOTTOM MARGIN:  Select this option to specify a bottom page  
  100.         margin in rows.  A maximum of 30 rows are permitted, and the    
  101.         bottom margin must be at least two rows if page numbers are re- 
  102.         quested.                                                        
  103.         
  104.            COLUMN WIDTH:  Select this option to specify the width in    
  105.         characters of the page you would like to use.  The default val- 
  106.         ue is 80 characters.  Other common values are 96 or 120 (equal  
  107.         to 12 CPI and 15 CPI text, respectively.                        
  108.         
  109.            PAGE NUMBERS:  Use this option to specify whether or not to  
  110.         paginate the formatted document.                                
  111.         
  112.            FORM FEEDS:  Use this option to tell MARGARINE how to handle 
  113.         form feed characters encountered in the input file.  Select "No 
  114.         Action" to simply leave the form feeds exactly where they were  
  115.         in the original file.  Select "Force page" to maintain the rel- 
  116.         ative position of the form feed within the document and adjust  
  117.         page numbers.  Select "Remove & ignore" to strip the form feeds 
  118.         out of the document.
  119.         
  120.            CONVERT CHARS:  Many printers emulate the Epson character    |
  121.         set which replaces the IBM extended characters with italic let- |
  122.  
  123.                                      Page 2
  124.  
  125.  
  126.  
  127.  
  128.  
  129.         ters.  These IBM characters are often used in documentation to  |
  130.         create boxes, tables, etc.  Setting this option to "YES" causes |
  131.         all extended box and line characters to be replaced by charac-  |
  132.         ters from the Epson standard character set.                     |
  133.         
  134.            Once you have selected all the applicable options, you can   
  135.         hit F10 to begin formatting the text file, or ESC to abort to   
  136.         DOS.                                                            
  137.         
  138.         
  139.            Help                                                         
  140.            
  141.            To obtain help from the menu, press F1.  Help for the spec-  
  142.         ific menu item will appear in a dialog box.  You can use the    
  143.         cursor arrows to scroll the text and view the entire help text. 
  144.         
  145.            
  146.            Command Line Operation                                       
  147.         
  148.            To run the program from the command line, use the following  
  149.         syntax:
  150.            
  151.          MARG file [outfile] [/Cnnn] [/Tnn [/Bnn] [/P] [/F+-] [/E] [/H] |
  152.         
  153.            file  --  This is the name of the file you would like to 
  154.            modify.  This is required.  The file must be in the cur-
  155.            rent directory.
  156.            
  157.            outfile  --  This is the name of the new file which will 
  158.            be written, containing the changes made to the original 
  159.            input file.  If none is specified, the first two char-
  160.            acters of input file will be changed to "$" and this will 
  161.            become the output file.
  162.         
  163.            /Cnnn  --  Set column width.  Normally, MARGARINE assumes
  164.            you want a document with 80 columns.  Use this switch to
  165.            specify an alternate width between 25 and 132 columns.  
  166.            This will have an impact on how much space is available for
  167.            the insertion of a left margin.   Replace nnn with the num-
  168.            ber of columns you desire.  If you specify less than 25 or 
  169.            more than 132 columns, the default of 80 columns will be
  170.            used.
  171.         
  172.            /Tnn  --  Set top margin.  Replace nn with the number of
  173.            lines you would like for a top margin.  This number must
  174.            be between 0 and 30.
  175.         
  176.            /Bnn  --  Set bottom margin.  Replace nn with the number
  177.            of lines you would like for a bottom margin.  This number
  178.            must also be between 0 and 30.  If not specified, this will
  179.            become the same as the top margin.  If you do not specify a
  180.            top margin, the bottom margin will always be zero and this
  181.            switch will be ignored.
  182.         
  183.  
  184.                                      Page 3
  185.  
  186.  
  187.  
  188.  
  189.  
  190.            /P --  Include page numbers.  A page number will be added
  191.            to each page of the document.  The page number will be cen-
  192.            tered on the bottom of each page, including the last.  You
  193.            must have specified a bottom margin of at least two lines.
  194.            
  195.            /F -- Form feeds.  This switch will affect the way in which  
  196.            MARGARINE handles form feed characters (ASCII 12) embedded   
  197.            in the input file.  /F+ will keep the form feeds in place,   
  198.            forcing a new page at the designated position.  Page numbers 
  199.            will be preserved if the /P option has also been specified.  
  200.            /F- will cause MARGARINE to remove all form feed characters.
  201.            
  202.            /E -- Extended character conversion.  Replaces all extended |
  203.            box and line drawing characters with standard characters    |
  204.            for printing on printers using Epson emulation.             |
  205.            
  206.            /H -- Help screen.  A brief help screen will be displayed
  207.            when MARG is entered alone on the command line or in con-
  208.            junction with the /H switch.  The DOS errorlevel is set to
  209.            1 when the /H switch is used.
  210.         
  211.            The command line switches may be preceded by either the "/" 
  212.         or "-" character and may be entered in any order.  The names of
  213.         the input and output files MUST be the first and second argu-
  214.         ments entered on the command line, respectively, and must be 
  215.         legal DOS file names.  The only exception to this is the /H 
  216.         switch which must be entered alone on the command line with the
  217.         "MARG" command.
  218.         
  219.         Command Examples:
  220.         
  221.            To add a left margin to the file TEST.DOC and write output
  222.         to the file $$ST.DOC:
  223.            
  224.               MARG test.doc
  225.               
  226.            
  227.            To add a left margin to the file TEST.DOC, write the output
  228.         to TEST.TXT, and use a column width of 96 (12 CPI Prestige):
  229.         
  230.               MARG test.doc test.txt /c96
  231.               
  232.               
  233.            To add a left margin to the file TEST.DOC, with one-inch
  234.         top and bottom margins, and write output to the file $$ST.DOC:
  235.         
  236.               MARG test.doc /t6
  237.               
  238.            
  239.            To add a left margin to the file TEST.DOC, write output to
  240.         TEST.TXT, with top margin of one inch and bottom margin of a
  241.         half inch, with page numbers and page width of 64 (8 CPI):
  242.         
  243.               MARG test.doc test.txt /t6 /b3 /p /c64
  244.  
  245.                                      Page 4
  246.  
  247.  
  248.  
  249.  
  250.  
  251.               
  252.         
  253.         Be careful!  MARGARINE is not very intelligent, and it will 
  254.         insert page breaks in some pretty silly places sometimes 
  255.         (like in the middle of a table).  For aesthetic purposes, you
  256.         may want to do some manual editing.
  257.         
  258.            Upon entering the proper command to begin the program, you
  259.         will be shown a message displaying the amount of space avail-
  260.         able for the left margin.  You will then be asked to enter the
  261.         value you actually want the program to use.  The output file 
  262.         will then be written.  While the output file is being written,
  263.         a "gas gauge" will appear showing what percentage of the oper-
  264.         ation has been completed (see below):
  265.         
  266.         0┬┬┬10┬┬┬20┬┬┬30┬┬┬40┬┬┬50┬┬┬60┬┬┬70┬┬┬80┬┬┬90┬┬100
  267.         ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  268.         
  269.         
  270.         Error Messages
  271.         
  272.            The program can produce several error messages:
  273.            
  274.         
  275.            "Line length too long to add margin."
  276.            
  277.            This message is printed if MARGARINE encounters a line in
  278.         your document that is longer than your specified column width.
  279.         If you have specified a top margin, execution of the program
  280.         continues and top, bottom, and/or page numbers will be added
  281.         normally.  If you have not specified a top margin, the DOS 
  282.         errorlevel is set to 4 and the program terminates.
  283.         
  284.            
  285.            "Incorrect number of parameters."
  286.            
  287.            This message is printed when you do not enter any parameters
  288.         on the command line, or enter too many parameters.  The help
  289.         screen is displayed, the DOS errorlevel is set to 2, and the
  290.         program terminates.
  291.         
  292.            
  293.            "*** Can't open input text file ***"
  294.              
  295.            This message is printed when the input file does not exist
  296.         or is not in the current directory.  The DOS errorlevel is set 
  297.         to 3 and the program terminates.
  298.         
  299.            
  300.            "*** Invalid entry.  Enter number between 0 and n"
  301.         
  302.            This message is printed if you enter a value for the left
  303.         margin that is too large or too small.
  304.         
  305.  
  306.                                      Page 5
  307.  
  308.  
  309.  
  310.  
  311.  
  312.            The DOS errorlevel is set to 0 upon successful termination
  313.         of the program.
  314.         
  315.            The program is also useful for adding margins to your own 
  316.         text file memos, letters, etc.  For example, the simple editor
  317.         that I use does not support margins or pagination.  I use 
  318.         MARGARINE to add a left margin to improve the appearance of my
  319.         documents, and to add top and bottom margins for a more profes-
  320.         sional look.  This document was formatted with MARGARINE 3.11 
  321.         producing the wide left margin, page breaks, and page numbers 
  322.         you see here.
  323.         
  324.         
  325.         REGISTRATION
  326.         
  327.            This program is a copyrighted work.  Many hours of effort
  328.         have gone into the creation of this program.
  329.         
  330.            You have a limited license to operate this program on your
  331.         computer for a period of no more than 30 days free of charge.
  332.         If, after this trial period, you decide you would like to 
  333.         continue using MARGARINE v3.11, you must register the program.
  334.         ANY OTHER USE OF THIS PROGRAM IS A VIOLATION OF COPYRIGHT LAWS.
  335.         
  336.            To register the program, send $15 to the address at the end
  337.         of this documentation.  Your registration fee gets you:
  338.         
  339.            - The latest version of MARGARINE on disk
  340.            
  341.            - Automatic shipment of version 4.0 on disk
  342.            
  343.            - Shareware versions of our other programs
  344.            
  345.         
  346.         DISCLAIMER
  347.         
  348.            This program is guaranteed to do absolutely NOTHING!  It 
  349.         does, however, in my experience perform reasonably close to
  350.         what is described herein.  The author assumes no liability
  351.         for loss or damage caused through the use of this program.
  352.         Before trying the program, especially for the first time
  353.         or on any important text files, make a backup copy of the
  354.         text files you are planning to manipulate.
  355.         
  356.         
  357.         ASP OMBUDSMAN
  358.         
  359.           This program is produced by a member of the Association of
  360.         Shareware Professionals (ASP).  ASP wants to make sure that
  361.         the shareware principle works for you.  If you are unable to
  362.         resolve a shareware-related problem with an ASP member by
  363.         contacting the member directly, ASP may be able to help.  The
  364.         ASP Ombudsman can help you resolve a dispute or problem with
  365.         an ASP member, but does not provide technical support for 
  366.  
  367.                                      Page 6
  368.  
  369.  
  370.  
  371.  
  372.  
  373.         members' products.  Please write to the ASP Ombudsman at 545
  374.         Grover Road, Muskegon, MI 49442 or send a CompuServe message
  375.         via CompuServe Mail to ASP Ombudsman, 70007,3536.
  376.         
  377.         
  378.         DISCLAIMER
  379.         
  380.            The programs described in this documentation are guaran-
  381.         teed to do absolutely nothing!  They have, however, in my exper-
  382.         ience performed essentially as described herein.  The author
  383.         will not be responsible for any loss or damages caused through
  384.         the use of these programs.  No warranty, express or implied,
  385.         is provided for this software's performance, merchantability,
  386.         or fitness for a particular purpose.
  387.         
  388.            All trademarks are property of their respective owners.
  389.         
  390.            The programs and documentation are Copyright 1991 by Tay-Jee
  391.         Software.  You are encouraged to distribute these programs pro-
  392.         vided the following conditions are met:
  393.         
  394.            - all files contained in the archive or distribution disk
  395.              must be distributed together in UNMODIFIED form
  396.         
  397.            - you charge no more than a reasonable fee for copying or
  398.              subscription, and clearly indicate that payment of such
  399.              a fee does NOT grant ownership of the programs.
  400.         
  401.            Send comments/registrations to:
  402.         
  403.                 Tay-Jee Software
  404.                 Post Office Box 835
  405.                 Lexington, VA 24450
  406.                 (703)464-5290
  407.                 
  408.                 !!!VIRGINIA RESIDENTS ADD 4.5SALES TAX!!!
  409.         
  410.                 CIS 72330,1776 (I haunt the IBMSYS and IBMPRO forums)
  411.         
  412.         
  413.            I welcome comments and suggestions from all.  I may be 
  414.         reached as indicated below:
  415.            
  416.            Tay-Jee Software            CIS:  72330,1776
  417.            P.O. Bix 835
  418.            Lexington, VA 24450
  419.            (703)464-5290 evenings
  420.            
  421.            I answer all phone calls, comments, and E-mail!
  422.         
  423.           
  424.                                   VERSION HISTORY
  425.           
  426.           3.11 - 11 January 1993:  Cleaned up menu interface
  427.  
  428.                                      Page 7
  429.  
  430.  
  431.  
  432.  
  433.  
  434.                                    Fixed minor bug with Epson conversions
  435.           
  436.           3.1  - 7 December 1992:  Added /E switch for Epson conversions
  437.           
  438.           3.0  - 12 October 1992:  Added /F parameter for form feeds
  439.                                    Added menu interface
  440.                                    Added context-sensitive online help
  441.           
  442.           2.81 - 21 December 1991:  Minor bug fix (damn those things!!)
  443.                          
  444.           2.8  - 20 December 1991:  Finally got around to reconstruc-
  445.                                     ting the source code after my hard
  446.                                     disk crashed
  447.                                     Added "gas gauge"
  448.                                     Improved help screen
  449.                                     Allowed top/bottom/pagination when
  450.                                     line length was too large for
  451.                                     adding a left margin
  452.                                     Improved error tones
  453.                          
  454.           2.7  - 15 August 1991:  Cleaned up command line interface
  455.                                   Added pagination option
  456.                                   Separate top and bottom margins
  457.                                   
  458.           2.6  -  9 August 1991:  Buffered I/O improves performance 100
  459.                                   
  460.           2.51 - 18 July 1991:  Minor bug fix
  461.         
  462.           2.5  - 17 July 1991:  Added support for top and bottom margins
  463.                         
  464.           2.1  - 31 May 1991:  Added support for 25-132 column printers
  465.         
  466.           2.0  - 16 May 1991:  Added support for command line 
  467.                                specification of input/output files
  468.                                Sounds tone on error
  469.                   
  470.           1.2  - 16 April 1991:  Prevents overwriting existing
  471.                                  output file
  472.                                  Allowed user control over margin width
  473.                   
  474.           1.1  - 14 April 1991:  Added improved error handling
  475.                                  procedures
  476.                                  Allowed user control over output file 
  477.                                  name
  478.         
  479.           1.0  - 10 April 1991:  Initial release
  480.         
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.                                      Page 8